


<script src="__TMPL__/public/assets/js/jquery-1.10.2.min.js"></script>
<script src="__TMPL__/public/assets/layui/layui.js"></script>
<script src="__STATIC__/js/laydate.js"></script>
<link  href="__TMPL__/public/assets/layui/css/layui.css" rel="stylesheet">
<script src="__STATIC__/js/echarts.min.js"></script>
<script>
    layui.use('laydate', function(){
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#test5' //指定元素
        });
    });
</script>

<style>

    .help-block{
        font-size: 12px !important;color: #777777;
    }
</style>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md8">

<form class="layui-form" action=""  lay-filter="example" style="padding-top: 20px" >


    <div class="layui-form-item">
        <label class="layui-form-label">标题</label>
        <div class="layui-input-block">
            <input type="text" name="title" lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">产品类型</label>
        <div class="layui-input-block">
            <select name="types" lay-filter="types">
                <option value="1" >酒类</option>
                <option value="2" >手机</option>
                <option value="3" >其他</option>
            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">型号</label>
        <div class="layui-input-block">
            <input type="text" name="desc" lay-verify="desc" autocomplete="off" placeholder="请输型号" class="layui-input">
            <p class="help-block">多个型号请用英文 , 分开</p>
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-block">
            <input type="text" name="order" lay-verify="order" autocomplete="off" placeholder="越大越靠前" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">截止时间</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input" name="endtime" id="test5" placeholder="yyyy-MM-dd HH:mm:ss">
        </div>
    </div>




    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="button" class="layui-btn" id="LAY-component-form-getval" lay-submit="" lay-filter="demo1">立即提交</button>

        </div>
    </div>
</form>

            <script>
                layui.use(['form', 'util', 'laydate'], function() {
                    var form = layui.form;
                    var layer = layui.layer;
                    var util = layui.util;
                    var laydate = layui.laydate;

                    //表单取值
                    layui.$('#LAY-component-form-getval').on('click', function () {
                        var data = form.val('example');

                        // var data=JSON.stringify(data);

                        console.log(data);

                        $.ajax({
                            url: '',
                            data: data,
                            type:'post',
                            success:function (res){
                                layer.msg(res.msg);

                                if (res.code==1){
                                    location.reload();
                                }


                            }
                        })




                    });
                })

            </script>


                </div>
    </div>
</div>